
<div class="cur_place">当前位置：首页&gt;&gt;留言</div>
<div id="middle">
	<div id="mid_main" style="float:left">
		<ul>
		<?php if($data){?>
		<?php 
			foreach ($data as $i=>$p){

				$ou = ($i%2==0) ? true : false;		
				?>				
				<li class='guestbookli' <?php if($ou) {echo ' style="background:#e5cd90"';} ?>>
					<?php 
					echo '<h3>', $p->title,'&nbsp;/留言人：<em>', $p->name, '</em></h3>'	;
				echo  '<div>', $p->content, '</div>';
				echo '<div>', $p->createtime, '</div>';

				if($p->reply) 
					echo '<div class="reply">回复：<br />', $p->reply, '</div>';
				?>
				</li>
				<?php 
				
			}
		?>
		<div style="clear:both; text-align:right" class="page"> <?php echo $pagination ;?> </div>
			<?php } //end of if data
			else{?>
				<div style="padding: 20px;">暂无留言</div>
			<?php }?>
		</ul>
		
		<form id="form1" name="form1" method="post" action="<?php echo site_url('guestbook/add') ?>" onsubmit="return chkmsg()">
  
  <table width="600" class="msg_show">
    <tr>
      <td width="139">您的大名：</td>
      <td width="449"><input name="name" type="text" id="name" maxlength="50" class="basic-input" />*</td>
    </tr>
    
    <tr>
      <td>联系电话：</td>
      <td><input name="phone" type="text" id="phone" size="20" maxlength="20"  class="basic-input" />*</td>
    </tr>
    <tr>
      <td>E-mail：</td>
      <td><input name="email" type="text" id="email" maxlength="100"  class="basic-input" /></td>
    </tr>
    <tr>
      <td>标题：</td>
      <td><input name="title" type="text" id="title" size="50" maxlength="50"  class="basic-input" />
      *</td>
    </tr>
    <tr>
      <td>内容：</td>
      <td><textarea name="content" cols="50" rows="8" id="content"></textarea>
      *</td>
    </tr>
    <tr>
		<td>验证码：</td>
		<td><span style="font-size:24px"><?php echo $yzm ?></span><input type="text" name="yzm" /> ：：算算这个题目吧
		</td>
	</tr>
    <tr>
      <td colspan="2"><div align="center">
        <input type="submit" name="Submit" value=" 提交 "  class="btn-submit"/>
        <input type="reset" name="Submit2" value=" 重置 "  class="btn-submit"/> 
      </div></td>
    </tr>
  </table>
</form>
<script src="/resources/scripts/jquery.validate.min.js" type="text/javascript"></script>
<script>
function chkmsg(){
	if( ! $("#form1").validate()){
		//alert('y');

	}else{
		//alert('n');
	}
}
$().ready(function() {
 $("#form1").validate({
        rules: {
   title: "required",
	content:"required",   	name:"required",	phone:"required", yzm:"required"
   },
    messages: {
   title: "请输入标题",
	content:"请输入内容",	name:"请输入您的称呼",	phone:"有了电话方便联系", yzm:"写上验证码请"}
 });
});
</script>
		
	</div>
	<div id="mid_aside">
		<div class="padl10">
		<!-- 产品索引 -->
		<div class="graybox">
			<h3>产品索引</h3>
						
			<?php $this->load->module('inc/home_made/protype_tree') ?>				
			
			
		</div> <!-- endof  产品索引 -->
		<!-- 联系方式 -->
		<?php $this->load->module('inc/home_made/contact_box')?>
		 <!-- endof  联系方式 -->
	</div>
	</div> 	<!-- endof  mid_aside-->
</div>

<?php $this->load->module('inc/home_made/footer')?>